import 'dart:ui';

import 'package:flutter/material.dart';

// class CompleteImage extends Container {
//   final String? url;
//   final double radius;
//   final Color bgColor;

//   CompleteImage(
//     this.url, {
//     super.key,
//     super.width,
//     super.height,
//     this.radius = 0,
//     this.bgColor = colorBg,
//   }) : super(
//          clipBehavior: Clip.antiAlias,
//          decoration: BoxDecoration(
//            borderRadius: BorderRadius.all(Radius.circular(radius)),
//            color: bgColor,
//          ),
//          child: Fast.emptys(url)
//              ? getIcon("ic_empty_box")
//              : CachedNetworkImage(
//                  fadeOutDuration: Duration(milliseconds: 200),
//                  fadeInDuration: Duration(milliseconds: 200),
//                  imageUrl: url ?? "",
//                  placeholder: (context, url) {
//                    return Center(child: getIcon("ic_living"));
//                  },

//                  errorWidget: (context, error, stackTrace) {
//                    return Center(child: getIcon("ic_fail"));
//                  },
//                  fit: BoxFit.cover,
//                ),
//        );
// }

class BorderContainer extends Container {
  final Color bdColor;
  final Color bgColor;
  final Gradient? gradient;
  final double bdWidth;
  final double radius;
  final bool shadow;

  BorderContainer({
    super.key,
    super.height,
    super.width,
    super.child,
    super.padding,
    super.margin,
    this.bdColor = Colors.white,
    this.bgColor = Colors.transparent,
    this.bdWidth = 0,
    this.radius = 0,
    this.shadow = false,
    this.gradient,
  }) : super(
         clipBehavior: Clip.antiAlias,
         decoration: BoxDecoration(
           color: gradient != null ? null : bgColor,
           gradient: gradient,
           border: bdWidth > 0
               ? BoxBorder.fromBorderSide(
                   BorderSide(color: bdColor, width: bdWidth),
                 )
               : null,
           borderRadius: radius != 0
               ? BorderRadius.all(Radius.circular(radius))
               : null,
           boxShadow: shadow
               ? [
                   BoxShadow(
                     offset: Offset(0, 4), //x,y轴
                     color: Color(0x4d939393), //投影颜色
                     blurRadius: 9, //投影距离
                   ),
                 ]
               : null,
         ),
       );
}
